package cn.dust.design.pattern.structural.composite;

/**
 * @Author: dust
 * @Date: 2019/11/26 22:29
 */
public class Cource extends CatalogComponent{

    private String name;
    private Double price;

    public Cource(String name, Double price) {
        this.name = name;
        this.price = price;
    }

    @Override
    public String getName(CatalogComponent catalogComponent) {
        return this.name;
    }

    @Override
    public double getPrice(CatalogComponent catalogComponent) {
        return this.price;
    }

    @Override
    public void print() {
        System.out.println("name:"+name+"   price:"+price);
    }
}
